<?php
declare(strict_types=1);

namespace App\JsonRpc;

use Hyperf\RpcServer\Annotation\RpcService;

/**
 * Class CalculatorService
 * @package App\JsonRpc
 * @RpcService(name="CalculatorService",protocol="jsonrpc-http",server="jsonrpc-http",publishTo="consul")
 */
class CalculatorService implements CalculatorServiceInterface
{
    /**
     * Notes:加法运算
     * Author:Liangshan
     * Date:2020/11/11
     * Time:17:13
     * param
     * @param int $a
     * @param int $b
     * @return int
     */
    public function add(int $a, int $b): int
    {
        sleep(2);
        return $a + $b;
    }
}